<%@page isELIgnored="false" import="java.net.*" %>
<%@taglib prefix="tiles" uri="struts-tiles" %>
<%@taglib prefix="html" uri="struts-html" %>
<%@taglib prefix="c" uri="jstl" %>
<%@taglib prefix="fn" uri="jstl-fn" %>
<%@taglib prefix="mcfn" uri="mcfn" %>
					
<%@page import="com.mastercard.assets.web.util.to.UserLogin"%><div id="bodyContent">
<c:set var="NumeroCampanas" value="${fn:length(ListarCampanasBancoForm.campanias)}"/>
<c:choose>
<c:when test="${NumeroCampanas eq 0}">
						<center>
							<bean:message key="com.mastercard.assets.web.modules.autorizarcampana.errors.NoCampaigns"/>
						</center>
</c:when>
<c:otherwise>
					<html:form action='/CampanasPorAutorizarCampanaDetalle' method='post' styleId='FormaAlta' >
						<html:hidden property="operation" styleId="operation"/>
						<html:hidden property="cveCampania" styleId="cveCampania"/>
						<!--<h1>Campa&ntilde;as relacionadas con tu usuario</h1>-->
						<div class='errors'><html:errors/>${UserLogin.messageError}</div>
						<table class="tabForms">
                                                        <tr>
                                                            <td colspan="10"><b>Status de campa&ntilde;as</b></td>
                                                        </tr>
							<tr>
								<td>
									<b>No. de Campa&ntilde;as: </b>&nbsp;&nbsp;&nbsp;&nbsp;${NumeroCampanas}
									<br/>
									<b>Campa&ntilde;as Por Autorizadas: </b>&nbsp;&nbsp;&nbsp;&nbsp;${ListarCampanasBancoForm.campanasPorAutorizar}
									<br/>
									<b>Campa&ntilde;as Autorizadas: </b>&nbsp;&nbsp;&nbsp;&nbsp;${ListarCampanasBancoForm.campanasAutorizadas}
									<br/>
									<b>Campa&ntilde;as Rechazadas: </b>&nbsp;&nbsp;&nbsp;&nbsp;${ListarCampanasBancoForm.campanasRechazadas}
								</td>
							</tr>
							<tr>
								<td colspan='4'>
									<table width='100%' class='AssetPaqueteTableDisplayPaquetes'>
										<thead>
											<tr>
												<th>Cuenta</th>
												<th>Campa&ntilde;a</th>
												<th>Tipo de Campa&ntilde;a</th>
												<th>Fecha de inicio</th>
												<th>Fecha de fin</th>
												<th>Estado</th>
											</tr>
										</thead>
<c:forEach items="${ListarCampanasBancoForm.campanias}" var="camp" varStatus="statusCamp">
										<tr onmouseover="this.style.background='lightgray';" onmouseout="this.style.background='white';">
											<td onmouseover="this.style.cursor='pointer';" onmouseout="this.style.cursor='default';" onclick="document.getElementById('cveCampania').value='${camp.cveCampania}';document.getElementById('FormaAlta').submit()" ><b>${camp.tblCuenta.nombre}</b></td>
											<td onmouseover="this.style.cursor='pointer';" onmouseout="this.style.cursor='default';" onclick="document.getElementById('cveCampania').value='${camp.cveCampania}';document.getElementById('FormaAlta').submit()" ><b>${mcfn:getShortString(camp.nombre,40)}</b></td>
											<td onmouseover="this.style.cursor='pointer';" onmouseout="this.style.cursor='default';" onclick="document.getElementById('cveCampania').value='${camp.cveCampania}';document.getElementById('FormaAlta').submit()" ><b>${mcfn:getShortString(camp.tblTipoCampania.nombre, 25)}</b></td>
											<td onmouseover="this.style.cursor='pointer';" onmouseout="this.style.cursor='default';" onclick="document.getElementById('cveCampania').value='${camp.cveCampania}';document.getElementById('FormaAlta').submit()" ><b>${mcfn:formatTimestamp(camp.fechaIni,'yyyy/MM/dd') }</b></td>
											<td onmouseover="this.style.cursor='pointer';" onmouseout="this.style.cursor='default';" onclick="document.getElementById('cveCampania').value='${camp.cveCampania}';document.getElementById('FormaAlta').submit()" ><b>${mcfn:formatTimestamp(camp.fechaFin,'yyyy/MM/dd') }</b></td>
											<td onmouseover="this.style.cursor='pointer';" onmouseout="this.style.cursor='default';" onclick="document.getElementById('cveCampania').value='${camp.cveCampania}';document.getElementById('FormaAlta').submit()" ><b><c:choose><c:when test="${camp.bandera eq 4}">Cancelada</c:when><c:when test="${camp.bandera eq 3}">Por Autorizar</c:when><c:when test="${camp.bandera eq 2}">Rechazada</c:when><c:when test="${camp.bandera eq 1}">Autorizada</c:when><c:when test="${camp.bandera eq 4}">Cancelada</c:when><c:otherwise>Desconocido</c:otherwise></c:choose></b></td>
 </c:forEach>
										</tr>
									</table>
								</td>
							</tr>
<!-- 
							<tr>
								<td colspan='4'>
									<span class="contentBtn"><html:image src="images/btnCancelar.gif" onclick="document.getElementById( 'operation' ).value = '3'; return true ;" /></span>
								</td>
							</tr>
 -->
						</table>
					</html:form>
</c:otherwise>
</c:choose>
					</div>
					<div id="footContent"></div>
<%
UserLogin user = ( UserLogin ) request.getSession( ).getAttribute( "UserLogin" ) ;

if( user != null )
	user.clearMessageError( ) ;
%>